set HUDSON_VERSION=1.371
set SLAVE_ADDINS=http://scm.vsuplift.cerner.corp/svn/tools/HudsonSlave/AddIns
set SVN_TOOLS=http://scm.vsuplift.cerner.corp/svn/tools
set DESTINATION=C:\hudson
set ADDINS=%DESTINATION%\AddIns
set JDK="C:\Program Files\Java\jdk1.6.0_43"
mkdir %ADDINS%\Slave
mkdir "C:\program files\cerner\"
cd %DESTINATION%

REM ## Install necessary Style sheets and Settings. ##
svn export %SLAVE_ADDINS%/FxCopReportByIssue.xsl %ADDINS%\FxCopReportByIssue.xsl --force
svn export %SLAVE_ADDINS%/PartCoverFullReport.xslt %ADDINS%\PartCoverFullReport.xslt --force
svn export %SLAVE_ADDINS%/standard.FxCop %ADDINS%\standard.FxCop --force
svn export %SLAVE_ADDINS%/standard10.FxCop %ADDINS%\standard10.FxCop --force

REM ## Copy Hudson Master Endstates to Slave for References. ##
svn export %SLAVE_ADDINS%/HudsonMasterEndstateExclusionList.txt %ADDINS%\HudsonMasterEndstateExclusionList.txt --force
xcopy "\\ipvmcisvsuplift\2012_01_winintel\*" %DESTINATION%\Winintel /C /R /Y /Z /H /K /D /EXCLUDE:%ADDINS%\HudsonMasterEndstateExclusionList.txt
xcopy "\\ipvmcisvsuplift\2012_01_wininteld\*" %DESTINATION%\Wininteld /C /R /Y /Z /H /K /D /EXCLUDE:%ADDINS%\HudsonMasterEndstateExclusionList.txt

xcopy \\ipvmcisvsuplift\2012_01_winintel\esm_msrmnt_mgr.dll "C:\program files\cerner\" /Y /D
xcopy \\ipvmcisvsuplift\2012_01_winintel\pvui.dll "C:\program files\cerner\" /Y /D
xcopy \\ipvmcisvsuplift\2012_01_winintel\appframeworkvbactivex.dll "C:\program files\cerner\" /Y /D

regsvr32 "C:\program files\cerner\appframeworkvbactivex.dll" /s

REM ## Install hudson slave jar and scripts. ##
cd %DESTINATION%
svn export %SLAVE_ADDINS%/Slave/slave-%HUDSON_VERSION%.jar %DESTINATION%\slave.jar --force
svn export %SLAVE_ADDINS%/Slave/launch.cmd %DESTINATION%\launch.cmd --force
svn export https://jenkinsbatch.googlecode.com/svn/trunk/start.cmd %DESTINATION%\start.cmd --force

start /min launch.cmd